import request from '@/utils/request'

//查询收费详情
export function listChargeQueryDetail(query) {
  return request({
    url: '/system/query/queryDetail',
    method: 'get',
    params: query
  })
}
// 查询收费查询列表
export function listChargeQuery(query) {
  return request({
    url: '/system/query/queryAll',
    method: 'get',
    params: query
  })
}
// 查询收费列表
export function listCharge(query) {
  return request({
    url: '/system/charge/list',
    method: 'get',
    params: query
  })
}

// 查询退费列表
export function listRefundQuery(query) {
  return request({
    url: '/system/refund/queryAll',
    method: 'get',
    params: query
  })
}

//更新支付状态
export function updatePay(query) {
  return request({
    url: '/system/charge/updateStatus',
    method: 'get',
    params: query
  })
}
//更新库存状态
export function updateStock(query) {
  return request({
    url: '/system/dispatch/updateStock',
    method: 'get',
    params: query
  })
}

//更新支付状态
export function updatePay2(query) {
  return request({
    url: '/system/query/updateStatus2',
    method: 'get',
    params: query
  })
}

//支付宝
export function aliPay(query) {
  return request({
    url: '/alipay/trade/page/pay',
    method: 'get',
    params: query
  })
}

export function aliPay2(query) {
  return request({
    url: '/alipay/trade/page/pay',
    method: 'get',
    params: query
  })
}

//-----------------------------------------------------------------
// 查询角色详细
export function getRole(roleId) {
  return request({
    url: '/system/role/' + roleId,
    method: 'get'
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/system/role',
    method: 'post',
    data: data
  })
}

// 修改角色
export function updateRole(data) {
  return request({
    url: '/system/role',
    method: 'put',
    data: data
  })
}

// 角色数据权限
export function dataScope(data) {
  return request({
    url: '/system/role/dataScope',
    method: 'put',
    data: data
  })
}

// 角色状态修改
export function changeRoleStatus(roleId, status) {
  const data = {
    roleId,
    status
  }
  return request({
    url: '/system/role/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除角色
export function delRole(roleId) {
  return request({
    url: '/system/role/' + roleId,
    method: 'delete'
  })
}

// 导出角色
export function exportRole(query) {
  return request({
    url: '/system/role/export',
    method: 'get',
    params: query
  })
}
